<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2023/12/12
 * Time: 10:44
 */

namespace app\api\model;

class PhoneCode extends Base
{
    /**
     * 查询验证码
     * @param $where
     * @return array|bool|\PDOStatement|string|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static function findCode($where = []){
        return self::where($where)->find();
    }

    /**
     * 更新验证码
     * @param $where
     * @param $update
     * @return PhoneCode
     */
    static function updateCode($where = [], $update = []){
        return self::where($where)->update($update);
    }

    /**
     * 新增验证码
     * @param $data
     * @return int|string
     */
    static function insertCode($data){
        return self::insert($data);
    }
}